<?php

namespace frontend\modules\yii\controllers;

use yii\web\Controller;

/**
 * Default controller for the `yii` module
 */
class BootstrapController extends Controller
{
    public $layout = "main";

    /**
     * Renders the index view for the module
     * @return string
     */
    public function actionIndex()
    {
        $page = \Yii::$app->request->get("page");
        if ($page) {
           return $this->renderAjax($page);
        }

        $linkOptions = ['style' => "color: #fafafa;font-weight: 600;background-color:#2697ed;"];
        \Yii::$app->params["header"] = [
            "left" => [
                ['label' => 'Bootstrap', 'url' => ['/yii/bootstrap/index'], 'linkOptions' => $linkOptions],
            ],
            "right" => [
                ['label' => 'About', 'url' => ['/yii/bootstrap/about'], 'linkOptions' => $linkOptions],
                ['label' => 'Contact', 'url' => ['/yii/bootstrap/contact'], 'linkOptions' => $linkOptions],
            ]
        ];

        return $this->render('index');
    }

    public function actionAbout(){
        return $this->render('about');
    }

    public function actionContact(){
        return $this->render('contact');
    }
}
